package com.sp.scmdb.daoImpl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.sp.scmdb.common.dao.BaseDaoSupport;
import com.sp.scmdb.dao.LabelReadingMachineDao;
import com.sp.scmdb.entity.LabelReadingMachine;

@Repository
public class LabelReadingMachineDaoImpl extends BaseDaoSupport<LabelReadingMachine> implements LabelReadingMachineDao {

	public List<LabelReadingMachine> queryByLrmID(String lrmID) {
		DetachedCriteria criteria = createDetachedCriteria();
		criteria.add(Restrictions.eq("lrmID", Integer.parseInt(lrmID)));
		List<LabelReadingMachine> list = queryCriteria(criteria);
		return list;
	}

	@SuppressWarnings("unchecked")
	public List<LabelReadingMachine> queryByLrmDetail(String Hql) {
		return findByQuery(Hql);
	}
}
